﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.MODEL;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.IDAL;
using KPIS.GERP.GFMS.DALFactory;

// test only
using KPIS.GERP.GFMS.DAL;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_FIM_MoneyReturnDtls : IBLL_FIM_MoneyReturnDtls
    {
        Common common = new Common();
        private static readonly IDAL_FIM_MoneyReturnDtls dal = DataAccess.Create_FIM_MoneyReturnDtls();

        public B_FIM_MoneyReturnDtls()
        {

        }

        public IList<M_FIM_MoneyReturnDtls> GetFull(string return_seq)
        {
            Nullable<int> nreturn_seq = common.ConvertNullInt(return_seq);
            return dal.GetFull(nreturn_seq);
        }

        public IList<M_FIM_MoneyReturnDtls> GetMoneyReqDtls(string return_seq, string money_req_seq)
        {
            Nullable<int> nreturn_seq = common.ConvertNullInt(return_seq);
            Nullable<int> nmoney_req_dtls_seq = common.ConvertNullInt(money_req_seq);
            return dal.GetMoneyReqDtls(nreturn_seq, nmoney_req_dtls_seq);
        }

        //public IList<M_FIM_MAS_Currencies> GetCurrencyList(string money_req_seq)
        //{
        //    Nullable<int> nmoney_req_dtls_seq = common.ConvertNullInt(money_req_seq);
        //    return dal.GetCurrencyList(nmoney_req_dtls_seq);
        //}

        public IList<M_FIM_MoneyReturnDtls> GetList(string return_seq)
        {
            Nullable<int> nreturn_seq = common.ConvertNullInt(return_seq);
            return dal.GetList(nreturn_seq);
        }

        public M_FIM_MoneyReturnDtls GetInfo(string seq)
        {
            int nSeq;
 
            if (seq == null)
                return null;

            if (common.IsNumeric(seq))
            {
                nSeq = int.Parse(seq);
                return dal.GetInfo(nSeq);
            }
            else
            {
                return null;
            }
        }

        public IList<M_FIM_MoneyReturnDtls> GetList2(int money_req_dtls_seq)
        {
            return dal.GetList2(money_req_dtls_seq);
        }

        public void Insert(M_FIM_MoneyReturnDtls info)
        {
            try
            {
                dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }

        public void Update(M_FIM_MoneyReturnDtls info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }

        public void UpdateBathAmount(string return_dtls_seq, string bath_amount)
        {
            try
            {
                dal.UpdateBathAmount(return_dtls_seq, bath_amount);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(M_FIM_MoneyReturnDtls info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }
    }
}
